package myhelpers

import (
	"hello/inits/config"
	"strconv"
)

var MHELPER *Helper

type Helper struct {
}

func BootstrapHelper() {
	MHELPER = &Helper{}
}

//获取后台基础路由
func (receiver Helper) GetAdminBaseUrl() string {
	return config.GetString("ADMIN_BASE_PATH")
}

// 获取后台路由
func (receiver Helper) GetAdminPath(url string) string {
	return "/" + receiver.GetAdminBaseUrl() + "/" + url
}

//Int64ToInt int64转int
func (h Helper) Int64ToInt(t int64) int {
	str := strconv.FormatInt(t, 10)
	countInt, _ := strconv.Atoi(str)
	return countInt
}
